const {
  getEventData
} = getApp()
Component({
  options: {
    addGlobalClass: true
  },
  properties: {
    data: Array,
    title: {
      type: String,
      value: ''
    },
    inset: Boolean,
    required: {
      type: Boolean,
      value: false
    },
    placeholder: {
      type: String,
      value: '请选择'
    },
    inset: {
      type: Boolean,
      value: false
    },
    valueKey: {
      type: String,
      value: ''
    },
    nodeKey: {
      type: String,
      value: ''
    }
  },

  data: {
    isShowPopup: false
  },
  methods: {
    handleClick() {
      this.triggerEvent('click');
    },


    handleShowDetail(event) {
      const {
        item
      } = getEventData(event)
      this.setData({
        currentItem: item,
        showDialog: true
      })
    },

    onCloseDetail() {
      this.setData({
        currentItem: null,
        showDialog: false
      })
    },
  }
})